/**
 * Created by mapbar_front on 2019/8/10.
 */
import React,{Component} from 'react';

function MyInput(props){
    console.log('props',props);
    return(
        <div>
            <input ref={props.inputRef}/>
        </div>
    )
}

class RefsDom3 extends Component{
    constructor(props){
        super(props);
        this.myRef = React.createRef();
    }
    componentDidMount(){
        this.myRef.current.focus();
        console.log('myInput',this.refs.myInput);
    }
    render(){
        return(
            <div>
                <MyInput inputRef={this.myRef}/>
                <input ref="myInput"/>
            </div>
        )
    }
}
export default RefsDom3;